<template>
  <div class="article">
    <div class="write">
      <nuxt-link to="/articles/artwrite">开始你的创作</nuxt-link>
    </div>
    <div class="art_search">
      <input type="text" v-model="keyword">
      <button>搜索</button>
    </div>
    <ArtList :artlist="artlist" cname="artlist_item"></ArtList>
  </div>
</template>

<script>

import ArtList from '~/components/article/ArtList.vue'
import { async } from 'q';

export default {
  components:{
    ArtList
  },
  data(){
    return{
      keyword:'',
    }
  },
  async asyncData({$axios}){
    let result= await $axios.$get('/art/search')
    return {artlist: result.msg}
  }
}
</script>

<style lang="scss" scoped>
  .article{
    padding: 20px;
    .art_search{
      display: flex;
      input{border-right: none;}
    }
    
  }
</style>